<?php
require_once 'MyPdo.class.php';
class MyPdoCounty{
	//$stat 为真时创建全新对象，为假时会返回单例模式的对象
	public static function init($db_host='',$db_name='',$db_user='',$db_pwd='',$stat=false){
		global $config;

		if(!$db_host){
			global $db_host;
		}

		$db_host = IpDecrypt($db_host);

		if(!$db_name){
			global $db_name;
		}

		if(!$db_host || !$db_name){
			echo 'db_host or db_name is miss!';
			return;
		}
		$db_user = $db_user?:$config['db_user'];
		$db_pwd = $db_pwd?:$config['db_pwd'];
		return MyPdo::init($db_host,$db_name,$db_user,$db_pwd,$stat);

	}

}
